namespace Digitalmes.Domain.Sys;

/// <summary>
/// 城市表
/// </summary>
[SugarTable("sys_city", "城市表")]
public class SysCity : EntityTenantId
{
    /// <summary>
    /// 城市名称
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "城市名称", Length = 64)]
    public string? Name { get; set; }

    /// <summary>
    /// 所属上级
    /// </summary>
    [SugarColumn(ColumnDescription = "所属上级")]
    public long ParentId { get; set; }

    /// <summary>
    /// 所属上级组
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "所属上级", IsJson = true, Length = 512)]
    public List<long>? ParentIdList { get; set; }

    /// <summary>
    /// 层级
    /// </summary>
    [SugarColumn(ColumnDescription = "层级")]
    public int Layer { get; set; } = 1;

    /// <summary>
    /// 城市编号
    /// </summary>
    [SugarColumn(ColumnDescription = "城市编号", Length = 32)]
    public string? Code { get; set; }

    /// <summary>
    /// 经度
    /// </summary>
    [SugarColumn(ColumnDescription = "经度", Length = 64)]
    public string? Longitude { get; set; }

    /// <summary>
    /// 纬度
    /// </summary>
    [SugarColumn(ColumnDescription = "纬度", Length = 64)]
    public string? Dimension { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    [SugarColumn(ColumnDescription = "排序")]
    public int Sort { get; set; } = 1;

    /// <summary>
    /// 添加时间
    /// </summary>
    [SugarColumn(ColumnDescription = "添加时间")]
    public DateTime AddTime { get; set; } = DateTime.Now;
}
